package cn.wfmiss.spring6.iocxml.diTest;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: wfmiss
 * @Date: 2023/12/31/12:56
 * @Description:员工类
 */
public class Emp {
    // 对象类型属性：员工属于某个部门
    private Dept dept;
    // 员工名称
    private String ename;
    // 员工年龄
    private Integer age;
    // 爱好
    private String[] hobby;

    public String[] getHobby() {
        return hobby;
    }

    public void setHobby(String[] hobby) {
        this.hobby = hobby;
    }


    public Dept getDept() {
        return dept;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "dept=" + dept +
                ", ename='" + ename + '\'' +
                ", age=" + age +
                ", hobby=" + Arrays.toString(hobby) +
                '}';
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void work() {
        System.out.println(ename + " :emp work..." + age);
        System.out.println("hobby=" + Arrays.toString(hobby));
        dept.info();
    }



}
